define(['jquery'],()=>{
	const baseurl='http://rap2api.taobao.org'
	const text_url = baseurl +'/app/mock/270856/api/text/102'
	const text_bast_url=baseurl+'/app/mock/270856/api/text'
	const cake_list_url='/libs/json/cakelist.json'
	const cake_url= baseurl+'/app/mock/270856/api/allcake'
	
	const get = (url, data) => {
	  return new Promise((resolve, reject) => {
	    $.get(url, data, resp => {
	      resolve(resp)
	    })
	  })
	}
	
	return{
		getCakeList(){
			return get(cake_list_url)
		},
		getText(){
		return get(text_url)
	},
	   getTextid(id){
		   return get(`${text_bast_url}/${id}`)
	   },
	   getcake(id){
		   return get(`${cake_url}/${id}`)
	   }
	}
})